package com.xzy.controller;

import com.xzy.annotaion.CheckDataPermission;
import com.xzy.dto.DeleteBookRequest;
import com.xzy.dto.UpdateBookRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xzy.xiao
 * @date 2023/6/16  9:43
 */
@Slf4j
@RestController
public class BookController {

    @PostMapping("/book/update")
    @CheckDataPermission(dataType = "book", paraClass = UpdateBookRequest.class, primaryKeyField = "bookId")
    public void update(@RequestBody UpdateBookRequest updateBookRequest) {
        log.info("... update");
    }

    @PostMapping("/book/delete")
    @CheckDataPermission(dataType = "book", paraClass = DeleteBookRequest.class, primaryKeyField = "bookId")
    public void delete(@RequestBody DeleteBookRequest deleteBookRequest) {
        log.info("... delete");
    }
}
